package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @Author: Sabrina
 * @Date:2025/06/10/14:22
 * @Description:
 */
@Mapper
public interface UserMapper {
    /**
     * 根据openid查询用户
     * @param openid
     * @return
     */
    @Select("SELECT * FROM user where openid = #{openid}")
    User isIdExists(String openid);

    /**
     * 插入数据
     * @param user
     */
    void insert(User user);

    @Select("SELECT * FROM user where id = #{userId}")
    User getUserById(Long userId);
}
